package com.yuanye.beans.Component;

import com.yuanye.model.Student;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

/**
 * @author liuyandeng
 * @date 2023/7/18
 * @Description
 */

@Component
public class StudentComponent {
//    @Scope("prototype")
    @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
    @Bean
    public Student studentNum1() {
        Student student = new Student();
        student.setId(1);
        student.setName("java");
        student.setPassword("123");
        return student;
    }
}
